using PMP.Core.Entities;
using PMP.Core.SqlSugar;

namespace PMP.Application.Apis;

/// <summary>
/// 标签接口
/// </summary>
[AllowAnonymous]
public class TagApi : IDynamicApiController
{
    /// <summary>
    /// 获取标签列表
    /// </summary>
    /// <param name="tagType">标签分类(0：用户；1：项目)</param>
    /// <returns></returns>
    public async Task<List<TbTag>> GetList([FromForm] int tagType)
    {
        var res = await DbContext.Instance.Queryable<TbTag>()
            .Where(a => a.TagType == tagType)
            .OrderBy(a => a.SortNum)
            .ToListAsync();
        return res;
    }
}